Lab 10: Departmental VLANs
Companion lab to Section 19 Understanding Switches.
.pkt files between sessions so you can pick up where you left off.Overview
| Session | Mode | What you do | What you see |
|---|---|---|---|
| 1 | Solo | Build a three-department LAN from scratch; create and assign VLANs entirely from the switch CLI. | Same-department pings succeed; all cross-department pings fail. |
| 2 | Solo | Add a DHCP server per VLAN so all 10 hosts receive addresses automatically. | Three isolated subnets; broadcasts stay inside each VLAN. |
| 3 | Pairs | Connect two students’ switches via a trunk link (configured via CLI) using Multiuser. | All three VLANs cross the trunk; VLAN isolation still holds. |
Prerequisites
- Cisco Packet Tracer 8.x installed and signed in with a free NetAcad account.
- Sessions 2 and 3 build on the previous session’s
.pktfile — save as you go. - For Session 3: both students must be reachable over IP (same classroom network or Tailscale).
- You will use the switch CLI (IOS) for all VLAN configuration — no GUI Config tab for VLANs.
IOS CLI Quick Reference
| What you want | Command |
|---|---|
| Enter privileged mode | enable |
| Enter global config | configure terminal |
| Create a VLAN | vlan <id> then name <name> |
| Select one interface | interface Fa0/<n> |
| Select a range of interfaces | interface range Fa0/<a>-<b> |
| Make port an access port | switchport mode access |
| Assign VLAN to access port | switchport access vlan <id> |
| Make port a trunk | switchport mode trunk |
| Exit one level | exit |
| Exit to privileged mode | end |
| Verify all VLANs | show vlan brief |
| Verify one port | show interfaces Fa0/<n> switchport |
Shared Network Plan
Three separate subnets, one per VLAN. All sessions use these throughout.
| Parameter | VLAN 10 — HR | VLAN 20 — Sales | VLAN 30 — Students |
|---|---|---|---|
| Network | 192.168.10.0/24 | 192.168.20.0/24 | 192.168.30.0/24 |
| Subnet mask | 255.255.255.0 | 255.255.255.0 | 255.255.255.0 |
| DHCP server (static) | 192.168.10.5 | 192.168.20.5 | 192.168.30.5 |
| DHCP scope | .10 – .100 | .10 – .100 | .10 – .100 |
VLAN and Port Plan
| Switch port | VLAN | Device |
|---|---|---|
Fa0/1 | 20 | Sales-PC1 |
Fa0/2 | 20 | Sales-PC2 |
Fa0/3 | 10 | HR-PC1 |
Fa0/4 | 10 | HR-PC2 |
Fa0/5 | 20 | Sales-DHCP (Session 2+) |
Fa0/6 | 10 | HR-DHCP (Session 2+) |
Fa0/7 | Trunk | Uplink to second switch (Session 3) |
Fa0/8 | 30 | Student-PC1 |
Fa0/9 | 30 | Student-PC2 |
Fa0/10 | 30 | Student-PC3 |
Fa0/11 | 30 | Student-PC4 |
Fa0/12 | 30 | Student-PC5 |
Fa0/13 | 30 | Student-PC6 |
Fa0/14 | 30 | Student-DHCP (Session 2+) |
Session 1 — Solo: Build the Topology and Configure VLANs via CLI
Time: ~50 min • Mode: Individual • Save as: Lab10_S1_<yourname>.pkt
Build the three-department LAN from scratch, then use IOS CLI commands to create VLANs and assign ports. No GUI Config tab for VLAN work — everything goes through the switch terminal.
1.1 Build the topology
- Open Packet Tracer → File → New.
- Drag onto the workspace:
- 1 × 2960 Switch (Switches category)
- 4 × PC — rename:
HR-PC1,HR-PC2,Sales-PC1,Sales-PC2 - 6 × PC — rename:
Student-PC1throughStudent-PC6
- Connect using Copper Straight-Through cables exactly as the port plan shows:
Sales-PC1→Fa0/1,Sales-PC2→Fa0/2HR-PC1→Fa0/3,HR-PC2→Fa0/4Student-PC1→Fa0/8…Student-PC6→Fa0/13
- Wait for all link lights to turn green.
1.2 Assign static IP addresses
Click each PC → Desktop → IP Configuration → Static.
| Device | IP Address | Subnet Mask |
|---|---|---|
| HR-PC1 | 192.168.10.11 | 255.255.255.0 |
| HR-PC2 | 192.168.10.12 | 255.255.255.0 |
| Sales-PC1 | 192.168.20.11 | 255.255.255.0 |
| Sales-PC2 | 192.168.20.12 | 255.255.255.0 |
| Student-PC1 | 192.168.30.11 | 255.255.255.0 |
| Student-PC2 | 192.168.30.12 | 255.255.255.0 |
| Student-PC3 | 192.168.30.13 | 255.255.255.0 |
| Student-PC4 | 192.168.30.14 | 255.255.255.0 |
| Student-PC5 | 192.168.30.15 | 255.255.255.0 |
| Student-PC6 | 192.168.30.16 | 255.255.255.0 |
Leave Default Gateway and DNS blank for now.
1.3 Baseline test before VLANs
All ports are in VLAN 1 (factory default). From HR-PC1 → Desktop → Command Prompt:
ping 192.168.10.12
Succeeds. Now:
ping 192.168.30.11
Fails — different subnet, no router. After VLAN configuration the cross-subnet ping fails for a new Layer 2 reason. Record both results.
1.4 Open the switch CLI
Click the switch → CLI tab. Press Enter to dismiss the banner. You land at:
Switch>
1.5 Create VLANs 10, 20, and 30 via CLI
Enter privileged mode, global config, then define all three VLANs:
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name HR
Switch(config-vlan)# vlan 20
Switch(config-vlan)# name Sales
Switch(config-vlan)# vlan 30
Switch(config-vlan)# name Students
Switch(config-vlan)# end
Verify the VLANs were created:
Switch# show vlan brief
You should see VLAN 10 (HR), 20 (Sales), and 30 (Students) listed as active, each with no ports assigned yet.
vlan 10 / name HR, simply type vlan 20 without exiting — IOS stays in VLAN config mode and switches context.1.6 Assign ports to their VLANs via CLI
Use interface range to assign multiple ports at once:
Switch# configure terminal
Switch(config)# interface range Fa0/1-2
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 20
Switch(config-if-range)# exit
Switch(config)# interface range Fa0/3-4
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# exit
Switch(config)# interface range Fa0/8-13
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 30
Switch(config-if-range)# end
Verify the assignments:
Switch# show vlan brief
VLAN 10: Fa0/3, Fa0/4 | VLAN 20: Fa0/1, Fa0/2 | VLAN 30: Fa0/8–13
% Invalid input detected: check your prompt level. Use end to return to Switch# and re-enter from configure terminal.1.7 Verify same-VLAN communication
From HR-PC1: ping 192.168.10.12 — succeeds.
From Sales-PC1: ping 192.168.20.12 — succeeds.
From Student-PC1: ping 192.168.30.16 — succeeds.
1.8 & 1.9 Verify cross-VLAN isolation and Simulation mode
From HR-PC1:
ping 192.168.20.11
Times out. Also try ping 192.168.30.11 — also times out. Repeat from Sales-PC1 and Student-PC1 to confirm all three VLANs are isolated from each other.
Session 1 completion checklist
- VLANs 10, 20, and 30 appear in
show vlan briefas active. - HR-PC1 ↔ HR-PC2: ping succeeds.
- Sales-PC1 ↔ Sales-PC2: ping succeeds.
- Student-PC1 ↔ Student-PC6: ping succeeds.
- HR-PC1 → Sales-PC1: ping times out.
- HR-PC1 → Student-PC1: ping times out.
- Sales-PC1 → Student-PC1: ping times out.
- Saved as
Lab10_S1_<yourname>.pkt.
Session 2 — Solo: DHCP Servers per VLAN
Time: ~45 min • Mode: Individual • Save as: Lab10_S2_<yourname>.pkt
Open your Session 1 file. Add one DHCP server per VLAN, assign their ports via CLI, and observe that broadcasts stay inside each VLAN.
2.1 Add the DHCP servers
- Drag three Server-PT devices onto the workspace. Rename:
HR-DHCP,Sales-DHCP,Student-DHCP. - Connect:
HR-DHCP→Fa0/6,Sales-DHCP→Fa0/5,Student-DHCP→Fa0/14.
2.2 Assign static IPs to the servers
| Server | IP Address | Subnet Mask |
|---|---|---|
| HR-DHCP | 192.168.10.5 | 255.255.255.0 |
| Sales-DHCP | 192.168.20.5 | 255.255.255.0 |
| Student-DHCP | 192.168.30.5 | 255.255.255.0 |
Click each server → Desktop → IP Configuration → Static.
2.3 Assign server ports to their VLANs (CLI)
Click the switch → CLI tab:
Switch# configure terminal
Switch(config)# interface Fa0/6
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
Switch(config)# interface Fa0/5
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
Switch(config)# interface Fa0/14
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 30
Switch(config-if)# end
Verify:
Switch# show vlan brief
VLAN 10 now includes Fa0/3, Fa0/4, Fa0/6. VLAN 20 includes Fa0/1, Fa0/2, Fa0/5. VLAN 30 includes Fa0/8–13, Fa0/14.
2.4 Configure DHCP on HR-DHCP
- Click
HR-DHCP→ Services → DHCP. - Edit pool
HR-Pool: Default Gateway192.168.10.1, DNS8.8.8.8, Start IP192.168.10.10, Mask255.255.255.0, Max Users91. - Click Save → Service: On.
2.5 Configure DHCP on Sales-DHCP
- Click
Sales-DHCP→ Services → DHCP. - Pool
Sales-Pool: Gateway192.168.20.1, DNS8.8.8.8, Start192.168.20.10, Mask255.255.255.0, Max91. - Click Save → Service: On.
2.6 Configure DHCP on Student-DHCP
- Click
Student-DHCP→ Services → DHCP. - Pool
Student-Pool: Gateway192.168.30.1, DNS8.8.8.8, Start192.168.30.10, Mask255.255.255.0, Max91. - Click Save → Service: On.
2.7 Switch all PCs to DHCP and verify
For each of the 10 PCs → Desktop → IP Configuration → DHCP. Expected address ranges:
| PC(s) | Expected range |
|---|---|
| HR-PC1, HR-PC2 | 192.168.10.10 – .100 |
| Sales-PC1, Sales-PC2 | 192.168.20.10 – .100 |
| Student-PC1 – PC6 | 192.168.30.10 – .100 |
169.254.x.x: DHCP Discover couldn’t reach the server. Run show vlan brief on the switch — is the server port in the right VLAN? Is Service set to On?Re-verify same-VLAN pings succeed and all cross-VLAN pings still time out.
2.8 Check the DHCP lease tables
On each DHCP server → Services → DHCP, scroll to the bottom:
HR-DHCP: 2 entries with192.168.10.xaddresses.Sales-DHCP: 2 entries with192.168.20.xaddresses.Student-DHCP: 6 entries with192.168.30.xaddresses.
Each server only served the hosts inside its own VLAN. Neither reached the other departments.
Session 2 completion checklist
- All three DHCP servers show Service: On.
- All 10 PCs received DHCP addresses in the correct subnet.
- Same-VLAN pings work for all three VLANs.
- All cross-VLAN pings time out.
- HR-DHCP: 2 leases | Sales-DHCP: 2 leases | Student-DHCP: 6 leases.
- Saved as
Lab10_S2_<yourname>.pkt.
Session 3 — Pairs: Inter-Switch Trunking with Multiuser
Time: ~50 min • Mode: Pairs • Save as: Lab10_S3_<yourname>.pkt
Each student runs their own Session 2 topology. Connect the two switches via a trunk link using Packet Tracer Multiuser, then configure the trunk port via CLI. Verify all three VLANs cross the trunk while VLAN isolation holds.
3.1 Verify host-OS network reachability
Windows
ipconfigmacOS / Linux
ifconfigNote your IP. From Student B’s host: ping <Student A’s IP>. If it fails, use the Tailscale fallback.
Student A must allow inbound TCP 38000:
- Windows: Windows Defender Firewall → Allow an app → Packet Tracer.
- macOS: System Settings → Network → Firewall → allow Packet Tracer.
- Linux:
sudo ufw allow 38000/tcp
3.2 & 3.3 Student A — set up Multiuser listen
- Open
Lab10_S2_<A>.pkt. Drag a Multiuser Connection cloud onto the workspace. Connect it toFa0/7. - Extensions → Multiuser → Listen… Port:
38000, Password:lab10trunk, New Remote Network: Always Accept → OK. - Share with Student B: host IP, port
38000, passwordlab10trunk.
Save as Lab10_S3_<A>.pkt.
3.4 Student B — connect to Student A
- Open
Lab10_S2_<B>.pkt. Drag a Multiuser Connection onto your workspace. Connect it toFa0/7. - Click the cloud → Outgoing Connections: Peer Address
<A’s IP>, Port38000, Passwordlab10trunk→ Connect. - Cloud turns green when the link is up.
3.5 Configure the trunk port on both switches (CLI)
Each student runs this on their own switch → CLI tab:
Switch# configure terminal
Switch(config)# interface Fa0/7
Switch(config-if)# switchport mode trunk
Switch(config-if)# end
Verify:
Switch# show interfaces Fa0/7 switchport
Look for Operational Mode: trunk and Trunking Encapsulation: dot1q.
3.6 – 3.8 Verify all VLANs cross the trunk, isolation holds
Exchange IPs with Student B (run ipconfig on their PCs).
VLAN 10 — HR across trunk:
ping 192.168.10.xx <-- Student B's HR-PC1
Should succeed.
VLAN 20 — Sales across trunk:
ping 192.168.20.xx <-- Student B's Sales-PC1
Should succeed.
VLAN 30 — Students across trunk:
ping 192.168.30.xx <-- Student B's Student-PC1
Should succeed.
Cross-VLAN isolation across trunk:
ping 192.168.20.xx <-- Student B's Sales-PC1 (from your HR-PC1)
Should time out. Also verify your HR-PC1 → Student B’s Student-PC1 times out, and your Student-PC1 → Student B’s Sales-PC1 times out.
Fa0/7, observe the 802.1Q tag with VLAN ID 10. When it arrives at Student B’s switch, the tag is stripped and the frame enters VLAN 10 on their side.Session 3 completion checklist
- Both Multiuser clouds are green.
show interfaces Fa0/7 switchportshows Operational Mode: trunk on both switches.- A’s HR-PC1 can ping B’s HR-PC1.
- A’s Sales-PC1 can ping B’s Sales-PC1.
- A’s Student-PC1 can ping B’s Student-PC1.
- A’s HR-PC1 cannot ping B’s Sales-PC1 or Student-PC1.
- A’s Sales-PC1 cannot ping B’s HR-PC1 or Student-PC1.
Tailscale Fallback (Session 3 only)
If campus Wi-Fi uses client isolation, install Tailscale on both computers, join the same tailnet, and use the 100.x.x.x Tailscale IP for the Multiuser Outgoing Connection. Full instructions are in Lab 9, Session 2.6.
Common Gotchas
| Symptom | Likely cause | Fix |
|---|---|---|
PC shows 169.254.x.x | Server port in wrong VLAN, or DHCP service Off | Run show vlan brief — verify the server’s port is listed under the correct VLAN. Turn Service On. |
show vlan brief shows VLAN but no ports | Port assignment step was skipped | Re-run the interface range / switchport access vlan commands. |
% Invalid input detected | Typo or wrong IOS prompt level | Use end to return to Switch#, then re-enter from configure terminal. |
| Same-VLAN ping fails after DHCP | PC received address from wrong pool | Run ipconfig — if HR-PC shows 192.168.20.x, its port is in VLAN 20. Fix: switchport access vlan 10. |
VLAN not in show vlan brief | VLAN not created yet | Run vlan <id> / name <name> from global config. |
| Multiuser cloud stays red | Wrong IP, password, or firewall blocks 38000 | Allow inbound TCP 38000 on Student A. Confirm host-OS ping works first. |
| Trunk port doesn’t carry VLANs | Port not in trunk mode on one or both sides | Run show interfaces Fa0/7 switchport. Re-run switchport mode trunk if needed. |
| Cross-VLAN ping across trunk succeeds | Both PCs in same VLAN on one switch | Run show vlan brief on both switches and compare membership. |
Quick Reflection Questions
- Why do you enter
switchport mode accessbeforeswitchport access vlan? What would happen if you skipped it? - Why does each VLAN need its own DHCP server (or a DHCP relay agent)?
- What is the difference between an access port and a trunk port?
- After configuring the trunk, why can A’s HR devices reach B’s HR devices but not B’s Sales devices?
- What would you need to add to allow controlled communication between the three VLANs?
- Which IOS command would you use in a real network to confirm a port is carrying the correct VLAN?
HR-DHCP (Services → HTTP → edit index.html) and visit http://192.168.10.5 from an HR PC’s Web Browser. Then try from a Sales PC or Student PC — the request should time out.